package com.example.administrator.kotlintutorial.`class`.construct

/**
 * Created by chensuilun on 2019/3/7.
 */

class User(val name: String, val age: Int) {

    operator fun component1() = name
    operator fun component2() = age
}

fun main() {
    val xiaoming = User("xiaoming", 18)
    val (name, age) = xiaoming
    println("name $name,age $age")
}